home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / SCREEN / VIRTPRS2.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-16  |  2KB  |  53 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; presentation of virtual screens with effects #2
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBSCR;
  10.  
  11.  
  12. const Methods    : array [1 .. 6] of PresentationMethodType
  13.                  = (Explode, Shrink, Fade, Push, Sweep, Float);
  14.       Directions : array [1 .. 4] of DirectionType
  15.                  = (Leftward, Rightward, Upward, Downward);
  16.       Speed      = 6; { Delay between presentation moves }
  17.  
  18. var MyVirtualScreen : VirtualScreenObjecttype;
  19.     MyBox : BoxObjectType; Index1, Index2 : word;
  20.  
  21. begin
  22.      Screen.Draw;
  23.  
  24.      with MyVirtualScreen do begin
  25.           InitializeRegion (1, 1, 80, 25);
  26.           { Draw some graphics in the virtual screen }
  27.           Fill (#177, Blue);
  28.           DrawLine (1, 1, 80, 25, #177, LightCyan + Blue * 16);
  29.           DrawLine (1, 25, 80, 1, #177, LightCyan + Blue * 16);
  30.  
  31.           { Present the graphics using all possible presentation methods
  32.             in all directions }
  33.           for Index1 := 1 to SizeOf(Methods) do
  34.               for Index2 := 1 to SizeOf(Directions) do
  35.                   if (Index1 > 3) or (Index2 = 1) then with MyBox do begin
  36.                      { Create a box on the physical screen }
  37.                      InitializeBox (9, 2, 71, 24, DoubleBorder);
  38.                      DrawLine (10, 3, 70, 23, #219, 14);
  39.                      DrawLine (10, 23, 70, 3, #219, 14);
  40.  
  41.                      { Present an area of the virtual screen }
  42.                      PresentArea (10, 3, 70, 23,      { Field to present }
  43.                                   10, 3,              { Where to present it }
  44.                                   Methods[Index1],    { Presentation method }
  45.                                   Directions[Index2], { Movement direction }
  46.                                   Speed);             { Delay between moves
  47.                                                         in milliseconds }
  48.                      Intercept; { Box }
  49.                 end;
  50.           Intercept;
  51.      end;
  52. end.
  53.